package cn.yuemouren.linkedlist.leetcode;

/**
 * @Author: Timi
 * @Description:  递归实现链表中给定数据删除问题
 * @Date: 2020/5/20 10:19
 */
public class Solution3 {
    public ListNode removeElements(ListNode head, int val) {
       if(head == null){
           return null;
       }
       head.next = removeElements(head.next,val);
       return head.val == val ? head.next : head;
    }
}
